<?= $this->partial('pm/pmlayout.phtml', array(
									'flid' => $this->flid, 
									'flArray' => $this->flArray,
									'fromto' => $this->fromto
									)
	); 
?>
<script>
function checkform(){
	if($('input[name="to_who"]').size()==1){
		var to_who=$("input[name='to_who']").val();
		if(trim(to_who)==""){
			parent.showMsg('请填写好您要发短信给谁!');
			return false;
		}
	}
	var subject=$("input[name='subject']").val();
	if(trim(subject)==''){
		parent.showMsg('请填写好您短信的主题!');
		return false;
	}

	commonEffection.setLoading();
	$('#pmForm').submit();
}
function setInputAll(thisInput){
	if($(thisInput).parent().find('input[name="to_who"]').size()==1){
		$(thisInput).parent().find('span').html('所有用户');
	}else{
		$(thisInput).parent().find('span').html('<input type="text" name="to_who" />');
	}
}
</script>
	<div class="pmItemDiv">
		<form name="pmForm" id="pmForm" action="administrator<?=CHOSING_DE?>pm<?=CHOSING_DE?>doadd" method="post">
			<div>发短信给:　<span><input type="text" name="to_who" value="<?=$this->sendto?>" /></span>　<input value="1" type="radio" name="idUsername" checked />用户名 <input value="0" type="radio" name="idUsername" />用户ID　　<input name="isAllUser" value="1" type="checkbox" onclick="setInputAll(this);" />所有用户</div>
			<div>
				短信类别:　<?=$this->flArray[$this->mustFlid-1]['flname']?><input name="flid" type="hidden" value="<?=$this->flArray[$this->mustFlid-1]['flid']?>" />
			</div>
			<div>短信主题:　<input type="text" name="subject" value="<?=$this->subject?>" /></div>
			<div>
				短信内容:<br />
				<?=$this->oFCKeditor->create();?>　
			</div>
			<div>是否保存到发件箱：<input type="radio" value="1" name="shouldSave" checked />是 <input type="radio" value="0" name="shouldSave" />否</div>
			<div>是否作为邮件发送：<input type="radio" value="1" name="isEmail" />是 <input checked type="radio" value="0" name="isEmail" />否</div>
			<div class="submitButton"><input onclick="checkform();" type="button" value="发送" /></div>
		</form>
	</div>
</div>